package p100;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class Leetcode_151 {
    public String reverseWords(String s) {
        List<String> ss = Arrays.stream(s.trim().split(" ")).collect(Collectors.toList());
        Collections.reverse(ss);
        return String.join(" ", ss);
    }

    public static void main(String[] args) {

    }
}
